/*
 +----------------------------------------------------------------------
 + Title        : 首页接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-07-08
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 首页接口
 +----------------------------------------------------------------------
*/
import type { GoodsItem, GoodsPageResult } from '@/types/goods'
import type { BannerItem } from '@/types/home'
import { http } from '@/utils/httpRequest'

/**
 * 获取首页推荐
 * @param number pageSize --------------------------------------条数
 *
 * return json
 * author huwl
 */
export const reqGetHomeRecommend = (pageSize: number) => {
  return http({
    method: 'GET',
    url: 'home/recommend',
    data: { page_size: pageSize }
  })
}

/**
 * 猜你喜欢
 * @param number page ------------------------------------------页码
 * @param number pageSize --------------------------------------条数
 *
 * return json
 * author huwl
 */
export const reqGetHomeGoodsGuessAPI = (page: number, pageSize: number) => {
  return http<GoodsPageResult<GoodsItem>>({
    method: 'GET',
    url: 'goods/search',
    data: { page, page_size: pageSize }
  })
}